﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../assets/css/yui-cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/x-icon" href="../assets/favicon.ico">
    <script src="../assets/js/yui-source.js"></script>
	<title>EaselJS v1.0.0 API Documentation : BitmapCache</title>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
            
                <h1><a href="http://createjs.site/easeljs"><img src="../assets/docs-icon-EaselJS.png" title="EaselJS"></a></h1>
            
        </div>
        <div class="version">
            <em>API Documentation for: 1.0.0</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
    <h2 class="off-left">APIs</h2>
    <div id="api-tabview" class="tabview">
        <ul class="tabs">
            <li><a href="#api-classes">Classes</a></li>
        </ul>

        <div id="api-tabview-filter">
            <input type="search" id="api-filter" placeholder="Type to filter APIs">
        </div>

        <div id="api-tabview-panel">
            <ul id="api-classes" class="apis classes">
            
                <li><a href="AlphaMapFilter.html">AlphaMapFilter</a></li>
            
                <li><a href="AlphaMaskFilter.html">AlphaMaskFilter</a></li>
            
                <li><a href="Bitmap.html">Bitmap</a></li>
            
                <li><a href="BitmapCache.html">BitmapCache</a></li>
            
                <li><a href="BitmapText.html">BitmapText</a></li>
            
                <li><a href="BlurFilter.html">BlurFilter</a></li>
            
                <li><a href="ButtonHelper.html">ButtonHelper</a></li>
            
                <li><a href="ColorFilter.html">ColorFilter</a></li>
            
                <li><a href="ColorMatrix.html">ColorMatrix</a></li>
            
                <li><a href="ColorMatrixFilter.html">ColorMatrixFilter</a></li>
            
                <li><a href="Container.html">Container</a></li>
            
                <li><a href="DisplayObject.html">DisplayObject</a></li>
            
                <li><a href="DisplayProps.html">DisplayProps</a></li>
            
                <li><a href="DOMElement.html">DOMElement</a></li>
            
                <li><a href="EaselJS.html">EaselJS</a></li>
            
                <li><a href="Event.html">Event</a></li>
            
                <li><a href="EventDispatcher.html">EventDispatcher</a></li>
            
                <li><a href="Filter.html">Filter</a></li>
            
                <li><a href="Graphics.html">Graphics</a></li>
            
                <li><a href="Graphics.Arc.html">Graphics.Arc</a></li>
            
                <li><a href="Graphics.ArcTo.html">Graphics.ArcTo</a></li>
            
                <li><a href="Graphics.BeginPath.html">Graphics.BeginPath</a></li>
            
                <li><a href="Graphics.BezierCurveTo.html">Graphics.BezierCurveTo</a></li>
            
                <li><a href="Graphics.Circle.html">Graphics.Circle</a></li>
            
                <li><a href="Graphics.ClosePath.html">Graphics.ClosePath</a></li>
            
                <li><a href="Graphics.Ellipse.html">Graphics.Ellipse</a></li>
            
                <li><a href="Graphics.Fill.html">Graphics.Fill</a></li>
            
                <li><a href="Graphics.LineTo.html">Graphics.LineTo</a></li>
            
                <li><a href="Graphics.MoveTo.html">Graphics.MoveTo</a></li>
            
                <li><a href="Graphics.PolyStar.html">Graphics.PolyStar</a></li>
            
                <li><a href="Graphics.QuadraticCurveTo.html">Graphics.QuadraticCurveTo</a></li>
            
                <li><a href="Graphics.Rect.html">Graphics.Rect</a></li>
            
                <li><a href="Graphics.RoundRect.html">Graphics.RoundRect</a></li>
            
                <li><a href="Graphics.Stroke.html">Graphics.Stroke</a></li>
            
                <li><a href="Graphics.StrokeDash.html">Graphics.StrokeDash</a></li>
            
                <li><a href="Graphics.StrokeStyle.html">Graphics.StrokeStyle</a></li>
            
                <li><a href="Matrix2D.html">Matrix2D</a></li>
            
                <li><a href="MouseEvent.html">MouseEvent</a></li>
            
                <li><a href="MovieClip.html">MovieClip</a></li>
            
                <li><a href="MovieClipPlugin.html">MovieClipPlugin</a></li>
            
                <li><a href="Point.html">Point</a></li>
            
                <li><a href="Rectangle.html">Rectangle</a></li>
            
                <li><a href="Shadow.html">Shadow</a></li>
            
                <li><a href="Shape.html">Shape</a></li>
            
                <li><a href="Sprite.html">Sprite</a></li>
            
                <li><a href="SpriteSheet.html">SpriteSheet</a></li>
            
                <li><a href="SpriteSheetBuilder.html">SpriteSheetBuilder</a></li>
            
                <li><a href="SpriteSheetUtils.html">SpriteSheetUtils</a></li>
            
                <li><a href="Stage.html">Stage</a></li>
            
                <li><a href="StageGL.html">StageGL</a></li>
            
                <li><a href="Text.html">Text</a></li>
            
                <li><a href="Ticker.html">Ticker</a></li>
            
                <li><a href="Touch.html">Touch</a></li>
            
                <li><a href="UID.html">UID</a></li>
            
                <li><a href="Utility%20Methods.html">Utility Methods</a></li>
            
                <li><a href="VideoBuffer.html">VideoBuffer</a></li>
            
                <li><a href="WebGLInspector.html">WebGLInspector</a></li>
            
            </ul>

            <ul id="api-modules" class="apis modules">
            
                <li><a href="../modules/CreateJS.html">CreateJS</a></li>
            
                <li><a href="../modules/EaselJS.html">EaselJS</a></li>
            
            </ul>
        </div>
    </div>
</div>

            </div>
        </div>
        <div class="yui3-u-3-4">
            <div id="api-options">
        Show:
        <label for="api-show-inherited">
            <input type="checkbox" id="api-show-inherited" checked="">
            Inherited
        </label>

        <label for="api-show-protected">
            <input type="checkbox" id="api-show-protected">
            Protected
        </label>

        <label for="api-show-private">
            <input type="checkbox" id="api-show-private">
            Private
        </label>
        <label for="api-show-deprecated">
            <input type="checkbox" id="api-show-deprecated">
            Deprecated
        </label>

    </div>
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
                        <h1>BitmapCache Class</h1>
<div class="box meta">
    

    

    
        <div class="foundat">
            Defined in: <a href="../files/easeljs_filters_BitmapCache.js.html#l41"><code>BitmapCache:41</code></a>
        </div>
    

    
        
            Module: <a href="../modules/EaselJS.html">EaselJS</a>
        
    

    
</div>



<div class="box intro">
    <p>The BitmapCache is an internal representation of all the cache properties and logic required in order to "cache"
an object. This information and functionality used to be located on a <a href="DisplayObject.html#method_cache" class="crosslink">cache</a>
method in <a href="DisplayObject.html" class="crosslink">DisplayObject</a>, but was moved to its own class.</p>
<p>Caching in this context is purely visual, and will render the DisplayObject out into an image to be used instead
of the object. The actual cache itself is still stored on the target with the <a href="DisplayObject.html#property_cacheCanvas" class="crosslink">cacheCanvas</a>.
Working with a singular image like a <a href="Bitmap.html" class="crosslink">Bitmap</a> there is little benefit to performing
a cache as it is already a single image. Caching is best done on containers containing multiple complex parts that
do not move often, so that rendering the image instead will improve overall rendering speed. A cached object will
not visually update until explicitly told to do so with a call to update, much like a Stage. If a cache is being
updated every frame it is likely not improving rendering performance. Cache are best used when updates will be sparse.</p>
<p>Caching is also a co-requisite for applying filters to prevent expensive filters running constantly without need,
and to physically enable some effects. The BitmapCache is also responsible for applying filters to objects and
reads each <a href="Filter.html" class="crosslink">Filter</a> due to this relationship. Real-time Filters are not recommended
performance wise when dealing with a Context2D canvas. For best performance and to still allow for some visual
effects use a compositeOperation when possible.</p>

</div>


    <div class="constructor">
        <h2>Constructor</h2>
        <div id="method_BitmapCache" class="method item">
    <h3 class="name"><code>BitmapCache</code></h3>

    
        <span class="paren">()</span>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l41"><code>BitmapCache:41</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        
    </div>

    

    

    
</div>

    </div>


<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

        
            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
        
        
            <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
        
        
        
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

            
                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                        
                            <li class="index-item method protected">
                                <a href="#method__applyFilters">_applyFilters</a>

                                
                                
                            </li>
                        
                            <li class="index-item method protected">
                                <a href="#method__drawToCache">_drawToCache</a>

                                
                                
                            </li>
                        
                            <li class="index-item method protected">
                                <a href="#method__updateSurface">_updateSurface</a>

                                
                                
                            </li>
                        
                            <li class="index-item method public">
                                <a href="#method_define">define</a>

                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_draw">draw</a>

                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_getBounds">getBounds</a>

                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_getCacheDataURL">getCacheDataURL</a>

                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_getFilterBounds">getFilterBounds</a>

                                
                                    <span class="flag static">static</span>
                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_release">release</a>

                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_toString">toString</a>

                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_update">update</a>

                                
                                
                            </li>
                        
                    </ul>
                </div>
            

            
                <div class="index-section properties">
                    <h3>Properties</h3>

                    <ul class="index-list properties">
                        
                            <li class="index-item property protected">
                                <a href="#property__boundRect">_boundRect</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property__cacheDataURL">_cacheDataURL</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property__cacheDataURLID">_cacheDataURLID</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property__drawHeight">_drawHeight</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property__drawWidth">_drawWidth</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property__filterOffY">_filterOffY</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property__filterOffY">_filterOffY</a>

                                
                                
                            </li>
                        
                            <li class="index-item property">
                                <a href="#property_cacheID">cacheID</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property_height">height</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property_offX">offX</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property_offY">offY</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property_scale">scale</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property_width">width</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property_x">x</a>

                                
                                
                            </li>
                        
                            <li class="index-item property protected">
                                <a href="#property_y">y</a>

                                
                                
                            </li>
                        
                    </ul>
                </div>
            

            

            
        </div>

        
            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

                
                    <div id="method__applyFilters" class="method item protected">
    <h3 class="name"><code>_applyFilters</code></h3>

    
        <span class="paren">()</span>
    

    

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l539"><code>_applyFilters:539</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Work through every filter and apply its individual visual transformation.</p>

    </div>

    

    

    
</div>

                
                    <div id="method__drawToCache" class="method item protected">
    <h3 class="name"><code>_drawToCache</code></h3>

    
        <span class="paren">()</span>
    

    

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l499"><code>_drawToCache:499</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Perform the cache draw out for context 2D now that the setup properties have been performed.</p>

    </div>

    

    

    
</div>

                
                    <div id="method__updateSurface" class="method item protected">
    <h3 class="name"><code>_updateSurface</code></h3>

    
        <span class="paren">()</span>
    

    

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l427"><code>_updateSurface:427</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Create or resize the invisible canvas/surface that is needed for the display object(s) to draw to,
and in turn be used in their stead when drawing. The surface is resized to the size defined
by the width and height, factoring in scaling and filters. Adjust them to adjust the output size.</p>

    </div>

    

    

    
</div>

                
                    <div id="method_define" class="method item public">
    <h3 class="name"><code>define</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>x</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>y</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>width</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>height</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code class="optional">[scale=1]</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code class="optional">[options=undefined]</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    

    

    
        <span class="flag public">public</span>
    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l247"><code>define:247</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Actually create the correct cache surface and properties associated with it. Caching and it&#39;s benefits are discussed
by the <a href="DisplayObject.html#method_cache" class="crosslink">cache</a> function and this class description. Here are the detailed
specifics of how to use the options object.</p>
<ul>
<li>If options.useGL is set to "new" a StageGL is created and contained on this for use when rendering the cache.</li>
<li>If options.useGL is set to "stage" if the current stage is a StageGL it will be used. If not then it will default to "new".</li>
<li>If options.useGL is a StageGL instance it will not create one but use the one provided.</li>
<li>If options.useGL is undefined a Context 2D cache will be performed.</li>
</ul>
<p>This means you can use any combination of StageGL and 2D with either, neither, or both the stage and cache being
WebGL. Using "new" with a StageGL display list is highly unrecommended, but still an option. It should be avoided
due to negative performance reasons and the Image loading limitation noted in the class complications above.</p>
<p>When "options.useGL" is set to the parent stage of the target and WebGL, performance is increased by using
"RenderTextures" instead of canvas elements. These are internal Textures on the graphics card stored in the GPU.
Because they are no longer canvases you cannot perform operations you could with a regular canvas. The benefit
is that this avoids the slowdown of copying the texture back and forth from the GPU to a Canvas element.
This means "stage" is the recommended option when available.</p>
<p>A StageGL cache does not infer the ability to draw objects a StageGL cannot currently draw, i.e. do not use a
WebGL context cache when caching a Shape, Text, etc.</p>
<h4>WebGL cache with a 2D context</h4>

<pre class="code prettyprint"><code>var stage = new createjs.Stage();
var bmp = new createjs.Bitmap(src);
bmp.cache(0, 0, bmp.width, bmp.height, 1, {gl: "new"});          // no StageGL to use, so make one

var shape = new createjs.Shape();
shape.graphics.clear().fill("red").drawRect(0,0,20,20);
shape.cache(0, 0, 20, 20, 1);                             // cannot use WebGL cache</code></pre>
<h4>WebGL cache with a WebGL context</h4>

<pre class="code prettyprint"><code>var stageGL = new createjs.StageGL();
var bmp = new createjs.Bitmap(src);
bmp.cache(0, 0, bmp.width, bmp.height, 1, {gl: "stage"});       // use our StageGL to cache

var shape = new createjs.Shape();
shape.graphics.clear().fill("red").drawRect(0,0,20,20);
shape.cache(0, 0, 20, 20, 1);                             // cannot use WebGL cache</code></pre>
<p>You may wish to create your own StageGL instance to control factors like clear color, transparency, AA, and
others. If you do, pass a new instance in instead of "true", the library will automatically set the
StageGL/isCacheControlled to true on your instance. This will trigger it to behave
correctly, and not assume your main context is WebGL.</p>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">x</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
                    

                    

                    <div class="param-description">
                        <p>The x coordinate origin for the cache region.</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">y</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
                    

                    

                    <div class="param-description">
                        <p>The y coordinate origin for the cache region.</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">width</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
                    

                    

                    <div class="param-description">
                        <p>The width of the cache region.</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">height</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
                    

                    

                    <div class="param-description">
                        <p>The height of the cache region.</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name optional">[scale=1]</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>
                    

                    

                    <div class="param-description">
                        <p>The scale at which the cache will be created. For example, if you cache a vector shape
using myShape.cache(0,0,100,100,2) then the resulting cacheCanvas will be 200x200 px. This lets you scale and
rotate cached elements with greater fidelity. Default is 1.</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name optional">[options=undefined]</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>
                    

                    

                    <div class="param-description">
                        <p>Specify additional parameters for the cache logic</p>

                    </div>

                    
                        <ul class="params-list">
                            
                            <li class="param">
                                
                                    <code class="param-name optional">[useGL=undefined]</code>
                                    <span class="type">Undefined | "new" | "stage" | <a href="StageGL.html" class="crosslink">StageGL</a></span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>
                                

                                <div class="param-description">
                                    <p>Select whether to use context 2D, or WebGL rendering, and
whether to make a new stage instance or use an existing one. See above for extensive details on use.</p>

                                </div>

                                
                            </li>
                            
                        </ul>
                    
                </li>
            
            </ul>
        </div>
    

    

    
</div>

                
                    <div id="method_draw" class="method item">
    <h3 class="name"><code>draw</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>ctx</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    
        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
        </span>
    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l398"><code>draw:398</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Use context2D drawing commands to display the cache canvas being used.</p>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">ctx</code>
                        <span class="type">CanvasRenderingContext2D</span>
                    

                    

                    <div class="param-description">
                        <p>The context to draw into.</p>

                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    
        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                
                    
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
                    
                    <p>Whether the draw was handled successfully.</p>

                
            </div>
        </div>
    

    
</div>

                
                    <div id="method_getBounds" class="method item">
    <h3 class="name"><code>getBounds</code></h3>

    
        <span class="paren">()</span>
    

    
        <span class="returns-inline">
            <span class="type"><a href="Rectangle.html" class="crosslink">Rectangle</a></span>
        </span>
    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l413"><code>getBounds:413</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Determine the bounds of the shape in local space.</p>

    </div>

    

    
        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                
                    
                        <span class="type"><a href="Rectangle.html" class="crosslink">Rectangle</a></span>:
                    
                
            </div>
        </div>
    

    
</div>

                
                    <div id="method_getCacheDataURL" class="method item">
    <h3 class="name"><code>getCacheDataURL</code></h3>

    
        <span class="paren">()</span>
    

    
        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
        </span>
    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l381"><code>getCacheDataURL:381</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Returns a data URL for the cache, or <code>null</code> if this display object is not cached.
Uses <a href="BitmapCache.html#property_cacheID" class="crosslink">cacheID</a> to ensure a new data URL is not generated if the
cache has not changed.</p>

    </div>

    

    
        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                
                    
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>:
                    
                    <p>The image data url for the cache.</p>

                
            </div>
        </div>
    

    
</div>

                
                    <div id="method_getFilterBounds" class="method item">
    <h3 class="name"><code>getFilterBounds</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>target</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code class="optional">[output=null]</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    
        <span class="returns-inline">
            <span class="type"><a href="Rectangle.html" class="crosslink">Rectangle</a></span>
        </span>
    

    

    

    

    
        <span class="flag static">static</span>
    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l208"><code>getFilterBounds:208</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Returns the bounds that surround all applied filters, relies on each filter to describe how it changes bounds.</p>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">target</code>
                        <span class="type"><a href="DisplayObject.html" class="crosslink">DisplayObject</a></span>
                    

                    

                    <div class="param-description">
                        <p>The object to check the filter bounds for.</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name optional">[output=null]</code>
                        <span class="type"><a href="Rectangle.html" class="crosslink">Rectangle</a></span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>
                    

                    

                    <div class="param-description">
                        <p>Optional parameter, if provided then calculated bounds will be applied to that object.</p>

                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    
        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                
                    
                        <span class="type"><a href="Rectangle.html" class="crosslink">Rectangle</a></span>:
                    
                    <p>bounds object representing the bounds with filters.</p>

                
            </div>
        </div>
    

    
</div>

                
                    <div id="method_release" class="method item">
    <h3 class="name"><code>release</code></h3>

    
        <span class="paren">()</span>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l353"><code>release:353</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Reset and release all the properties and memory associated with this cache.</p>

    </div>

    

    

    
</div>

                
                    <div id="method_toString" class="method item">
    <h3 class="name"><code>toString</code></h3>

    
        <span class="paren">()</span>
    

    
        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
        </span>
    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l238"><code>toString:238</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Returns a string representation of this object.</p>

    </div>

    

    
        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                
                    
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>:
                    
                    <p>a string representation of the instance.</p>

                
            </div>
        </div>
    

    
</div>

                
                    <div id="method_update" class="method item">
    <h3 class="name"><code>update</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code class="optional">[compositeOperation=null]</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l322"><code>update:322</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Directly called via <a href="DisplayObject.html#method_updateCache" class="crosslink">updateCache</a>, but also internally. This
has the dual responsibility of making sure the surface is ready to be drawn to, and performing the draw. For
full details of each behaviour, check the protected functions <a href="BitmapCache.html#method__updateSurface" class="crosslink">_updateSurface</a>
and <a href="BitmapCache.html#method__drawToCache" class="crosslink">_drawToCache</a> respectively.</p>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name optional">[compositeOperation=null]</code>
                        <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>
                    

                    

                    <div class="param-description">
                        <p>The DisplayObject this cache is linked to.</p>

                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    

    
</div>

                
            </div>
        

        
            <div id="properties" class="api-class-tabpanel">
                <h2 class="off-left">Properties</h2>

                
                    <div id="property__boundRect" class="property item protected">
    <h3 class="name"><code>_boundRect</code></h3>
    <span class="type"><a href="Rectangle.html" class="crosslink">Rectangle</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l197"><code>_boundRect:197</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Internal tracking of the last requested bounds, may happen repeadtedly so stored to avoid object creation</p>

    </div>

    
        <p><strong>Default:</strong> 0</p>
    

    

    
</div>

                
                    <div id="property__cacheDataURL" class="property item protected">
    <h3 class="name"><code>_cacheDataURL</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l170"><code>_cacheDataURL:170</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The cache&#39;s DataURL, generated on-demand using the getter.</p>

    </div>

    
        <p><strong>Default:</strong> null</p>
    

    

    
</div>

                
                    <div id="property__cacheDataURLID" class="property item protected">
    <h3 class="name"><code>_cacheDataURLID</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l161"><code>_cacheDataURLID:161</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The cacheID when a DataURL was requested.</p>

    </div>

    
        <p><strong>Default:</strong> 0</p>
    

    

    
</div>

                
                    <div id="property__drawHeight" class="property item protected">
    <h3 class="name"><code>_drawHeight</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l188"><code>_drawHeight:188</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Internal tracking of final bounding height, approximately height*scale; however, filters can complicate the actual value.</p>

    </div>

    
        <p><strong>Default:</strong> 0</p>
    

    

    
</div>

                
                    <div id="property__drawWidth" class="property item protected">
    <h3 class="name"><code>_drawWidth</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l179"><code>_drawWidth:179</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Internal tracking of final bounding width, approximately width*scale; however, filters can complicate the actual value.</p>

    </div>

    
        <p><strong>Default:</strong> 0</p>
    

    

    
</div>

                
                    <div id="property__filterOffY" class="property item protected">
    <h3 class="name"><code>_filterOffY</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l151"><code>_filterOffY:151</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The relative offset of the filter&#39;s y position, used for drawing the cache onto its container.
Re-calculated every update call before drawing.</p>

    </div>

    
        <p><strong>Default:</strong> 0</p>
    

    

    
</div>

                
                    <div id="property__filterOffY" class="property item protected">
    <h3 class="name"><code>_filterOffY</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l141"><code>_filterOffY:141</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The relative offset of the filter&#39;s x position, used for drawing the cache onto its container.
Re-calculated every update call before drawing.</p>

    </div>

    
        <p><strong>Default:</strong> 0</p>
    

    

    
</div>

                
                    <div id="property_cacheID" class="property item">
    <h3 class="name"><code>cacheID</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l131"><code>cacheID:131</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Track how many times the cache has been updated, mostly used for preventing duplicate cacheURLs.
This can be useful to see if a cache has been updated.</p>

    </div>

    
        <p><strong>Default:</strong> 0</p>
    

    

    
</div>

                
                    <div id="property_height" class="property item protected">
    <h3 class="name"><code>height</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l74"><code>height:74</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Height of the cache relative to the target object.</p>

    </div>

    
        <p><strong>Default:</strong> undefined</p>
    

    

    
</div>

                
                    <div id="property_offX" class="property item protected">
    <h3 class="name"><code>offX</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l113"><code>offX:113</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The x offset used for drawing into the cache itself, accounts for both transforms applied.</p>

    </div>

    
        <p><strong>Default:</strong> 0</p>
    

    

    
</div>

                
                    <div id="property_offY" class="property item protected">
    <h3 class="name"><code>offY</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l122"><code>offY:122</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The y offset used for drawing into the cache itself, accounts for both transforms applied.</p>

    </div>

    
        <p><strong>Default:</strong> 0</p>
    

    

    
</div>

                
                    <div id="property_scale" class="property item protected">
    <h3 class="name"><code>scale</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l102"><code>scale:102</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>The internal scale of the cache image, does not affects display size. This is useful to both increase and
decrease render quality. Objects with increased scales are more likely to look good when scaled up or rotated.
Objects with decreased scales can save on rendering performance.</p>

    </div>

    
        <p><strong>Default:</strong> 1</p>
    

    

    
</div>

                
                    <div id="property_width" class="property item protected">
    <h3 class="name"><code>width</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l65"><code>width:65</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Width of the cache relative to the target object.</p>

    </div>

    
        <p><strong>Default:</strong> undefined</p>
    

    

    
</div>

                
                    <div id="property_x" class="property item protected">
    <h3 class="name"><code>x</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l84"><code>x:84</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Horizontal position of the cache relative to the target&#39;s origin.</p>

    </div>

    
        <p><strong>Default:</strong> undefined</p>
    

    

    
</div>

                
                    <div id="property_y" class="property item protected">
    <h3 class="name"><code>y</code></h3>
    <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>

    

    
        <span class="flag protected">protected</span>
    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/easeljs_filters_BitmapCache.js.html#l93"><code>y:93</code></a>
        
        </p>

        

        
    </div>

    <div class="description">
        <p>Vertical position of the cache relative to target&#39;s origin.</p>

    </div>

    
        <p><strong>Default:</strong> undefined</p>
    

    

    
</div>

                
            </div>
        

        

        
    </div>
</div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
